﻿@{
    Layout = null;
    var pic = ViewBag.Pic as List<BuyWithoutLoseMoney.Core.Models.ProductPic>;
}
@model BuyWithoutLoseMoney.Core.Models.Product;
<!DOCTYPE html>
<html>
<head>
    <meta name="viewport" content="width=device-width" />
    <title>Edit</title>
    <script src="/js/vue.js"></script>
    <!-- 引入样式 -->
    <link href="/lib/element-ui/theme-chalk/index.min.css" rel="stylesheet" />
    <!-- 引入组件库 -->
    <script src="/lib/element-ui/index.min.js"></script>
</head>
<body>
    <div id="app">
        <div style="text-align:center;">@Model.Title</div>
        <div class="demo-image">
            <el-card class="box-card">
                <div slot="header" class="clearfix">
                    <span style="text-align:center;">主图</span>
                   @* <el-button style="float: right; padding: 3px 0" type="text"><a href="/admin/product/upload" style="text-decoration: none;">添加</a></el-button>*@
                </div>
                <div>
                    @foreach (var item in pic.Where(x => x.ProductId == Model.Id && x.PicType == 1))
                    {
                        <el-image style="width: 100px; height: 100px" src="@item.PicAddress" :fit="fit"></el-image>

                    }
                </div>
            </el-card>
        </div> 
        <div class="demo-image">
            <el-card class="box-card">
                <div slot="header" class="clearfix">
                    <span style="text-align:center;">副图</span>
                   @* <el-button style="float: right; padding: 3px 0" type="text"><a href="/admin/product/upload" style="text-decoration: none;">添加</a></el-button>*@
                </div>
                <div>
                    @foreach (var item in pic.Where(x => x.ProductId == Model.Id && x.PicType == 2))
                        {
                            <el-image style="width: 100px; height: 100px" src="@item.PicAddress" :fit="fit"></el-image>
                        }
                </div>
            </el-card>
        </div>
    </div>
    <script>
        new Vue({
            el: '#app',
            data: function() {
                return {
                    visible: false
                }
            }

        })
    </script>

</body>
</html>